/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author XYMTOP
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface TbOrder extends BasicModel<TbOrder> {
  orderId?: string; // 订单号
  createTime?: string; // 订单创建时间
  clientName?: string; // 客户姓名
  phone?: string; // 联系电话
  address?: string; // 地址
  partner?: string; // 合作方
  orderManager?: string; // 客户经理
  orderStatus?: string; // 订单状态
  reserveAmount?: number; // 定金金额
  amount?: number; // 合同金额
  afterSales?: number; // 是否有售后（0无售后，1有售后）
  afterSalesOrder?: string; // 售后补单编号
  comment?: string; // 备注
  deleted?: number; // 逻辑删除（0正常，1删除）
}

export const tbOrderList = (params?: TbOrder | any) =>
  defHttp.get<TbOrder>({ url: adminPath + '/tb/tbOrder/getById', params });
// 我的订单
export const tbOrderMyListData = (params?: TbOrder | any) =>
  defHttp.post<Page<TbOrder>>({ url: adminPath + '/order/findMyOrder', params });
// 部门订单
export const tbOrderListData = (params?: TbOrder | any) =>
  defHttp.post<Page<TbOrder>>({ url: adminPath + '/order/findMyDepartmentOrder', params });

export const OrderListData = (params?: TbOrder | any) =>
  defHttp.post<Page<TbOrder>>({ url: adminPath + '/order/getById', params });
// 获取部门经理
export const OrderwholeListData = (params?: any) =>
  defHttp.post({ url: adminPath + '/order/findwholeData', params });

export const tbOrderForm = (params?: TbOrder | any) =>
  defHttp.get<TbOrder>({ url: adminPath + '/tb/tbOrder/form', params });

export const tbOrderSave = (params?: any, data?: TbOrder | any) =>
  defHttp.post<TbOrder>({ url: adminPath + '/order/save', params, data });

export const tbOrderDelete = (params?: TbOrder | any) =>
  defHttp.get<TbOrder>({ url: adminPath + '/order/delete', params });

export const tbOrderUpdate = (data?: TbOrder | any) =>
  defHttp.postJson<TbOrder>({ url: adminPath + '/order/update', data });

export const tbGetUserRole = () => defHttp.get({ url: adminPath + '/user/getMyRole' });

export const tbgetContent = (params: any) =>
  defHttp.post({ url: adminPath + '/supplierOrder/getSupplierOrder', params });
export const tbgetpic = (params: any) =>
  defHttp.get({ url: adminPath + '/orderStatus/getpic', params });
//获取到任务弹窗
export  const getDelayOrderTip = ()=>
  defHttp.get({url:adminPath+'/order/getDelayOrderTip'})
// 订单管理员
export const tbgetOrderManager = (params: any) =>
  defHttp.get({ url: adminPath + '/user/findOrderManager', params });
// 设计师
  export const tbgetDesigner = (params: any) =>
  defHttp.get({ url: adminPath + '/user/findDesignerInDepartment', params });

// 合作方
export const tbgetPartnerOfCompany = (params: any) =>
defHttp.get({ url: adminPath + '/user/findPartnerOfCompany', params });
  // 获取用户的信息
export  const  tbGetUserInfo = () =>
  defHttp.get({ url: adminPath + '/user/getMyEmployeeInfo' });
  // 获取设计部
  export  const  tbgetOfficeCode = () =>
  defHttp.get({ url: adminPath + '/orderStatus/get_design_department' });
